package com.linewell.system.dao.impl;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.linewell.commom.dao.impl.BaseDaoImpl;
import com.linewell.system.dao.ISysNoticeDao;
import com.linewell.system.model.SysNotice;
/**
 * 具体实现SysNotice的CRUD
 * 
 * */
@Repository
public class SysNoticeDao extends BaseDaoImpl<SysNotice> implements ISysNoticeDao {

	@Override
	public boolean deleteAll(String ids) {
		String hql = "delete SysNotice n where n.id in ("+ids+") ";
		Query query = super.sessionFactory.getCurrentSession().createQuery(hql);
		return (query.executeUpdate() > 0);
	}

	@Override
	public boolean removeAll(String ids) {
		// TODO Auto-generated method stub
		String hql = "update SysNotice n set n.status = 0 where n.id in ("+ids+") ";
		Query query = super.sessionFactory.getCurrentSession().createQuery(hql);
		return (query.executeUpdate() > 0);
	}

}
